import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "demo",
    component: () => import("@/views/demo2.vue"),
    meta: {
      title: "demo页面",
      keepalive: true,
    },
    //对路由的描述信息
  },
  {
    path: "/detail/:id",
    name: "detail",
    component: () => import("@/views/detail.vue"),
  },
  {
    path: "/cros",
    name: "cors",
    component: () => import("@/views/cros.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
